import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

export type infoType = {
  projectId?: number,
	projectName?: string,
	city?: any,
	remark?: number,
	contactName?: number,
	contactPhone?: number,
	buildDate?: string,
	address?: string,
  lat?:number,
  lng?:any,
  center?:any,
  mapPoints?:any,
  area?: any
  openFunc?: any,
  expireStatus?:any
}


const Url = '/business/project/v2/project';

export const getInfo = (params?: object) => {
  return http.request<commonResult<infoType>>("get", Url, {
    params
  });
};

export const editInfo = (data?: object) => {
  return http.request<commonResult<any>>("put", Url, {
    data
  });
};
 /** 2.5.1.3顶部单位和项目切换的项目部分 */
 export const getProjectList = (params?: object) => {
  return http.request<commonResult<{data:infoType[],total:number}>>("get", '/business/project/v2/project-op', {
    params
  });
};